package studychinese.utils;

import android.content.Context;

import com.hschinese.pronunciation.activity.MyApplication;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.request.PostRequest;

import studychinese.model.LzyResponse;
import studychinese.model.UserBean;

/**
 * Created by zf on 2018/1/5.
 */

public class OkGoUtil  {
    public Context context;

    public OkGoUtil(Context context) {
        this.context = context;
    }


    public static PostRequest<String> getOKParamsId(String url, Context context) {
        String verSionName = VerSionNameUtil.getVerSionName(MyApplication.getInstance());
        UserBean userBean = SPUtils.getObject(MyApplication.getInstance(), "userInfo", "userInfo", UserBean.class);
        PostRequest<String> post = OkGo.<String>post(url);
        post.tag(context);
       // post.params("token",userBean.getToken());
        post.params("version",verSionName);
        post.params("phoneType","1");
        post.params("phoneModel", SystemUtil.getDeviceBrand()+SystemUtil.getSystemModel());
        post.params("systemVersion",SystemUtil.getSystemVersion()+"");
        PostRequest<LzyResponse> post1 = OkGo.<LzyResponse>post(url);


        return post;
    }


}
